<?php

$actorID;
$action;
$level;
$typ;
$code;
$num;

if (file_exists("config.xml")) {
	$config_xml = simplexml_load_file("config.xml");
} else {
	exit("Konnte Datei nicht laden. ");
}

if (isset($_GET["actorID"])) {
	$actorID = $_GET["actorID"];
} else {
	$actorID = '006';
}



$path = '/config/Actors/Actor[@ID=\'' . $actorID . '\']';

$actor = $config_xml -> xpath($path);
//Layout für einen Dimmer
//var_dump ($actor);
if ($actor[0]->Dim == 'DIM') {
	
	echo "
				<a href=# data-rel=back data-role=button data-theme=a data-icon=delete data-iconpos=notext class=ui-btn-right>Close</a>
				<ul data-role=listview id=stepPopupUL0>
					<li>
						<table width=100%>
							<tr>
								<td width=30%>
								<div data-role='navbar' data-iconpos='top'>
									<ul>
										<li>
											<a href=# onClick=\"perform_light_change('$actorID', 'BRIGHT', 0);\" data-icon='plus'>
											<br>
											Heller
											<br>
											<br>
											</a>
										</li>
									</ul>
								</div>
								<div data-role='navbar' data-iconpos='bottom'>
									<ul>
										<li>
											<a href=# onClick=\"perform_light_change('$actorID', 'DARK', 0);\" data-icon='minus'>
											<br>
											Dunkler
											<br>
											<br>
											</a>
										</li>
									</ul>
								</div></td><td width=70% >
								<div >
									<div>

										<input class='knob' data-width='200' data-displayPrevious='true' data-fgColor='#ffec03' data-skin='tron' data-cursor='true' value='8' data-thickness='.5' data-min='0' data-max='16'>
									</div>
								</div></td>
							</tr>
							<tr>
								<td colspan=2>
								<div data-role='navbar' data-iconpos='top'>
									<ul>
										<li>
											<a href=# onClick=\"perform_light_change('$actorID', 'ON', 0);\" data-icon='plus'>ON</a>
										</li>
										<li>
											<a href=# onClick=\"perform_light_change('$actorID', 'OFF', 0);\"  data-icon='plus'>OFF</a>
										</li>
									</ul>
								</div></td>
							</tr>
						</table>
					</li>
				</ul>	
	";
} else if ($actor[0]->Dim == 'NODIM') 
{
echo "
				<a href=# data-rel=back data-role=button data-theme=a data-icon=delete data-iconpos=notext class=ui-btn-right>Close</a>
					<table width=100%>
						<tr>
							<td colspan=2>
								<div data-role='navbar' data-iconpos='top'>
								<ul>
									<li>
										<a href=# onClick=\"perform_light_change('$actorID', 'ON', 0);\"  data-icon='plus'>ON</a>
									</li>
									<li>
										<a href=# onClick=\"perform_light_change('$actorID', 'OFF', 0);\" data-icon='plus'>OFF</a>
									</li>
								</ul>
							</div></td>
						</tr>
					</table>";
}




?>